﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EbookCopier
{
    /// <summary>
    /// 模拟鼠标点击 配置面板。
    /// </summary>
    public partial class MouseCmderOptionsForm : Form
    {
        MouseCmder cmder = null;
        /// <summary>
        /// 初始化类 <see cref="MouseCmderOptionsForm"/> 的新实例。
        /// </summary>
        /// <param name="cmder">要设置的 MouseCmder 实例。</param>
        public MouseCmderOptionsForm(MouseCmder cmder)
        {
            InitializeComponent();

            this.cmder = cmder;

            btnSetMouse_Pre.Click += new EventHandler(btnSetMouse_Pre_Click);
            btnSetMouse_Next.Click += new EventHandler(btnSetMouse_Next_Click);
        }
        void btnSetMouse_Next_Click(object sender, EventArgs e)
        {
            SetLocationForm form = new SetLocationForm(Screen.PrimaryScreen);
            if (form.ShowDialog(this.TopLevelControl) == DialogResult.OK)
            {
                cmder.NextPageMouseLocation = form.MouseLocation;
            }
        }

        void btnSetMouse_Pre_Click(object sender, EventArgs e)
        {
            SetLocationForm form = new SetLocationForm(Screen.PrimaryScreen);
            if (form.ShowDialog(this.TopLevelControl) == DialogResult.OK)
            {
                cmder.PrevPageMouseLocation = form.MouseLocation;
            }
        }
    }
}